// Base styles for elements
body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: $font-family;
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

a:focus,
a:active {
  outline: none;
}

a,
a:focus,
a:hover {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

div:focus {
  outline: none;
}

// Clear fix
.clearfix {
  &:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
  }
}

// Scrollbar
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #909399;
  border-radius: 3px;
  
  &:hover {
    background: #606266;
  }
}

// 全局重置样式
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

// 文本溢出省略
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 基础布局类
.app-container {
  padding: 20px;
}

// 通用卡片样式
.app-card {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

// 通用链接样式
.app-link {
  color: #409EFF;
  text-decoration: none;
  &:hover {
    color: #66b1ff;
  }
}

// 通用按钮样式
.app-button {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  
  &.primary {
    background: #409EFF;
    color: #fff;
    border: 1px solid #409EFF;
    &:hover {
      background: #66b1ff;
      border-color: #66b1ff;
    }
  }
}

// 通用表单样式
.app-form {
  .form-item {
    margin-bottom: 22px;
    
    &:last-child {
      margin-bottom: 0;
    }
  }
}

// 通用表格样式
.app-table {
  width: 100%;
  border-collapse: collapse;
  
  th, td {
    padding: 12px 8px;
    border-bottom: 1px solid #ebeef5;
  }
  
  th {
    background-color: #fafafa;
    color: #606266;
    font-weight: 500;
  }
}

// 通用图标样式
.app-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}

// 通用头像样式
.app-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

// 布局相关
.app-wrapper {
  position: relative;
  height: 100%;
  width: 100%;
}

// 侧边栏相关
.sidebar-container {
  transition: width 0.28s;
  background-color: #304156;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  
  .logo-container {
    height: 50px;
    padding: 10px;
    display: flex;
    align-items: center;
    background: #2b2f3a;
    
    img {
      width: 32px;
      height: 32px;
      margin-right: 12px;
    }
    
    span {
      color: #fff;
      font-size: 16px;
      font-weight: 600;
    }
  }
}

// 导航栏相关
.navbar {
  height: 50px;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  
  .hamburger-container {
    line-height: 46px;
    height: 100%;
    float: left;
    padding: 0 15px;
    cursor: pointer;
    transition: background .3s;
    
    &:hover {
      background: rgba(0, 0, 0, .025);
    }
  }
  
  .right-menu {
    float: right;
    height: 100%;
    line-height: 50px;
    padding: 0 15px;
    
    &:focus {
      outline: none;
    }
  }
}

// 主要内容区
.main-container {
  min-height: 100%;
  transition: margin-left .28s;
  margin-left: 200px;
  position: relative;
  background-color: #f0f2f5;
}

// 过渡动画
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}

// 响应式布局
@media (max-width: 768px) {
  .app-wrapper {
    .sidebar-container {
      width: 54px !important;
    }
    .main-container {
      margin-left: 54px;
    }
  }
} 